//package com.ugoodtech.mdcc.core.repository;
//
//import com.ugoodtech.mdcc.core.domain.CustomerSatisfactionReport;
//import org.springframework.data.jpa.repository.Query;
//import org.springframework.data.querydsl.QueryDslPredicateExecutor;
//import org.springframework.data.repository.CrudRepository;
//import org.springframework.data.repository.query.Param;
//
//import java.util.List;
//
//public interface CustomerSatisfactionReportRepository extends CrudRepository<CustomerSatisfactionReport, Long>,
//        QueryDslPredicateExecutor<CustomerSatisfactionReport> {
//
//    @Query(value = "select a.name,count(b.id) from question_answer_options a left join customer_satisfaction_report b on b.beforeTheService=a.name  where a.question_id=159 group by a.name", nativeQuery = true)
//    List<Object[]> getBeforeTheService();
//
//    @Query(value = "select a.name,count(b.id) from question_answer_options a left join customer_satisfaction_report b on b.isExpect=a.name  where a.question_id=159 group by a.name", nativeQuery = true)
//    List<Object[]> getIsExpect();
//
//    @Query(value = "select a.name,count(b.id) from question_answer_options a left join customer_satisfaction_report b on b.isOnTime=a.name  where a.question_id=159 group by a.name", nativeQuery = true)
//    List<Object[]> getIsOnTime();
//
//    @Query(value = "select a.name,count(b.id) from question_answer_options a left join customer_satisfaction_report b on b.IsUniform=a.name  where a.question_id=159 group by a.name", nativeQuery = true)
//    List<Object[]> getIsUniform();
//
//    @Query(value = "select a.name,count(b.id) from question_answer_options a left join customer_satisfaction_report b on b.score=a.name  where a.question_id=159 group by a.name", nativeQuery = true)
//    List<Object[]> getScore();
//
//    @Query(value = "select a.name,count(b.id) from question_answer_options a left join customer_satisfaction_report b on b.solution=a.name  where a.question_id=159 group by a.name", nativeQuery = true)
//    List<Object[]> getSolution();
//
//    @Query(value = "select a.name,count(b.id) from question_answer_options a left join customer_satisfaction_report b on b.workAttitude=a.name  where a.question_id=159 group by a.name", nativeQuery = true)
//    List<Object[]> getWorkAttitude();
//
//    @Query(value = "select sum(beforeTheService)/100/(select count(*) from customer_satisfaction_report)*10 from customer_satisfaction_report", nativeQuery = true)
//    Object getAverageBeforeTheService();
//
//    @Query(value = "select sum(isExpect)/100/(select count(*) from customer_satisfaction_report)*10 from customer_satisfaction_report", nativeQuery = true)
//    Object getAverageIsExpect();
//
//    @Query(value = "select sum(isOnTime)/100/(select count(*) from customer_satisfaction_report)*10 from customer_satisfaction_report", nativeQuery = true)
//    Object getAverageIsOnTime();
//
//    @Query(value = "select sum(isUniform)/100/(select count(*) from customer_satisfaction_report)*10 from customer_satisfaction_report", nativeQuery = true)
//    Object getAverageIsUniform();
//
//    @Query(value = "select sum(score)/100/(select count(*) from customer_satisfaction_report)*10 from customer_satisfaction_report", nativeQuery = true)
//    Object getAverageScore();
//
//    @Query(value = "select sum(solution)/100/(select count(*) from customer_satisfaction_report)*10 from customer_satisfaction_report", nativeQuery = true)
//    Object getAverageSolution();
//
//    @Query(value = "select sum(workAttitude)/100/(select count(*) from customer_satisfaction_report)*10 from customer_satisfaction_report", nativeQuery = true)
//    Object getAverageWorkAttitude();
//
//    @Query(value = "select count(*) from customer_satisfaction_report", nativeQuery = true)
//    Integer countRow();
//
//
//}
